/// @tags: Matrix QuickPow KthSystem
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long ll;

int const N = 55, mod = 998244353, K = 178;

int n, m, q;
int deg[N];
int mp[N][N];

struct Matrix {
  int a[N][N];

  Matrix() { memset(a, 0, sizeof(a)); }

  inline Matrix operator*(Matrix const &rhs) const {
    Matrix res;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        for (int k = 0; k < n; ++k)
          if ((res.a[i][j] += (ll)a[i][k] * rhs.a[k][j] % mod) >= mod) res.a[i][j] -= mod;
    return res;
  }

  inline friend ostream &operator<<(ostream &os, Matrix const &rhs) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) os << rhs.a[i][j] << ' ';
      os << '\n';
    }
    return os;
  }
} T[4][K];

struct Vector {
  int a[N];

  Vector() { memset(a, 0, sizeof(a)); }

  inline Vector operator*(Matrix const &rhs) const {
    Vector res;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        if ((res.a[i] += (ll)a[j] * rhs.a[j][i] % mod) >= mod) res.a[i] -= mod;
    return res;
  }
} A;

inline ll qpow(ll base, int exp) {
  ll res = 1;
  while (exp) {
    if (exp & 1) res = res * base % mod;
    base = base * base % mod;
    exp >>= 1;
  }
  return res;
}

inline void prework() {
  for (int j = 2; j < K; ++j) T[0][j] = T[0][1] * T[0][j - 1];
  for (int i = 1; i < 4; ++i) {
    T[i][1] = T[i - 1][1] * T[i - 1][K - 1];
    // cerr << T[i][1] << '\n';
    for (int j = 2; j < K; ++j) T[i][j] = T[i][1] * T[i][j - 1];
  }
}

inline Vector query(Vector x, int t) {
  for (int i = 0; t; t /= K, ++i)
    if (t % K) x = x * T[i][t % K];
  return x;
}

inline int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i) cin >> A.a[i];
  for (int i = 1, x, y; i <= m; ++i) {
    cin >> x >> y;
    --x, --y;
    ++deg[x];
    mp[x][y]++;
  }
  for (int i = 0; i < n; ++i) {
    mp[i][i]++, ++deg[i];
    int inv = qpow(deg[i], mod - 2);
    for (int j = 0; j < n; ++j)
      if (mp[i][j]) T[0][1].a[i][j] = (ll)inv * mp[i][j] % mod;
  }
  prework();
  for (int t; q; --q) {
    cin >> t;
    Vector ans = query(A, t);
    int Ans = 0;
    for (int i = 0; i < n; ++i) Ans ^= ans.a[i];
    cout << Ans % mod << '\n';
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P5107 能量采集.in", "r", stdin);
  freopen("P5107 能量采集.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
